package violencerecursion;

import java.util.Random;

public class Coin {
    public static void main(String[] args) {
        Random random = new Random();
        int time = 1000000;
        int heads = 0,tails = 0;
        for(int i = 0;i <= time;i++){
            int a = random.nextInt(2);
            if(a == 0){
                heads++;
            }else if(a == 1){
                tails++;
            }
        }
        System.out.println("正面朝上heads = "+heads+" 反面朝上tails = "+tails);
    }
}